function sayHi(){
    console.log('Hello',this.name)
}
var person2={
    name:'gch',
    sayHi:sayHi,
}
var person1={
    name:'lwb',
    friend:person2
}
//当函数作为对象的方法时，this 指向这个对象，当前对象是 person2
var obj=person1.friend;
obj.sayHi();
person1.friend.sayHi();